function menuTree(data, isDelete = false) {

    for (let i = 0; i < data.length; i++) {
        data[i].child = [];
        for (let j = 0; j < data.length; j++) {
            if (data[j].preNodeID === data[i].id) {
                data[i].child.push(data[j]);
            }
        }
    }
    if (isDelete) {
        data = data.filter(item => {
            return !item.preNodeID
        });
    }
    return data
}
module.exports = {
    menuTree,
};